←Select platform

ReadBarcode(RasterImage,LogicalRectangle,BarcodeSymbology[]) Method

Summary

Read one barcode from an image with a symbology from a specified group and the default options.

Syntax

C#
VB
Java
Objective-C
WinRT C#
C++
- (nullable LTBarcodeData *)readBarcode:(LTRasterImage *)image  
                           searchBounds:(LeadRect)searchBounds  
                            symbologies:(nullable NSArray<NSNumber *> *)symbologies  
                                  error:(NSError **)error 
             
public BarcodeData readBarcode( 
  RasterImage image,  
  LeadRect searchBounds,  
  BarcodeSymbology[] symbologies 
) 
             
 function Leadtools.Barcode.BarcodeReader.ReadBarcode(RasterImage,LogicalRectangle,BarcodeSymbology[])(  
   image , 
   searchBounds , 
   symbologies  
) 

Parameters

image
A RasterImage object that contains the image data. Must not be null (Nothing in VB).

searchBounds
A LogicalRectangle that specifies the region of interest area in the image where the barcode search and detection is performed. Specify LogicalRectangle.Empty to indicate that the search must be performed on the whole image.

symbologies
An array of BarcodeSymbology enumeration members that specifies the barcode symbologies (types) to search for.

Return Value

An instance of BarcodeData or one of its derived classes that contains the symbology, data, location and any rotation angle of the barcode found. If no barcodes can be found, then this method will return null (Nothing in VB).

Remarks

For more information on barcode reading, refer to BarcodeReader.

Use this method if you want to read a single barcode from a known group. For example, to read a barcode that can be of any UPC type, pass an array of BarcodeSymbology.UPCA and BarcodeSymbology.UPCE.

This method will use the default read options set in this BarcodeReader for all the items in symbologies.

LEADTOOLS barcode read engine is optimized for speed and can search for multiple similar symbologies at the same time. This method simply returns the first barcode that is detected correctly using the symbologies and current options.

The ReadSymbology event will occur before and after attempting to read any symbology. The read options being used whether the default or specified will be set in the BarcodeReadSymbologyEventArgs.Options property of the event data.

If symbologies is null (Nothing in VB), then this method will use all the currently available symbologies. If this parameter contains an empty array, then no barcode will be detected and null (Nothing in VB) will be returned.

The BarcodeReader provides the following barcode read methods:

Method Description
ReadBarcode(RasterImage image, LogicalRectangle searchBounds, BarcodeSymbology symbology) and ReadBarcode(RasterImage image, LogicalRectangle searchBounds, BarcodeSymbology symbology, BarcodeReadOptions options)

Read one barcode from an image with specified symbology and default or specific options. Use these methods if you want to read a single barcode from the image, for example, a QR symbol by specifying BarcodeSymbology.QR or if you want to read any barcode found regardless of its type by using BarcodeSymbology.Unknown.

ReadBarcode(RasterImage image, LogicalRectangle searchBounds, BarcodeSymbology[] symbologies) and ReadBarcode(RasterImage image, LogicalRectangle searchBounds, BarcodeSymbology[] symbologies, BarcodeReadOptions[] options)

Read one barcode from an image with a symbology from a specified group and default or specific options. Uses these methods if you want to read a single barcode from a known group. For example, to read a barcode that can be of any UPC type, pass an array of BarcodeSymbology.UPCA and BarcodeSymbology.UPCE.

ReadBarcodes(RasterImage image, LogicalRectangle searchBounds, int maximumBarcodes, BarcodeSymbology[] symbologies) and ReadBarcodes(RasterImage image, LogicalRectangle searchBounds, int maximumBarcodes, BarcodeSymbology[] symbologies, BarcodeReadOptions[] options)

Read multiple barcodes from an image with symbologies from a specified group and default or specific options. Use these methods if you want to read multiple barcodes of the same or multiple symbologies.

Example

This example shows how to use this method to read any UPC barcode used to identify products from an image.

 

Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Barcode Assembly